package com.imooc.controller;

import com.imooc.service.FdfsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: 顾志杰
 * @Date: 2019/12/5
 * @Time: 10:45
 */
@RestController
@RequestMapping("fdfs")
public class FastdfsController {
    @Autowired
    private FdfsService fdfsService;


    @PostMapping("upload")
    public String upload(MultipartFile file)throws Exception {
        String upload = fdfsService.upload(file);
        return "文件地址："+upload;
    }

}
